Skip to content

fix(cli): warn on silent embedder degradation in update paths - #1852

Open
sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/update-degrade-warn
Open

fix(cli): warn on silent embedder degradation in update paths#1852
sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/update-degrade-warn

Conversation

@sloemo01

Copy link
Copy Markdown
Contributor

What

Closes the residual R3 gap from #852/#1370: embedder-degradation warnings were reported once per call site instead of once per invocation.

repowise update builds the embedder for its decision semantic-dedup store (incremental.py) and again for the deterministic page path (deterministic.py); a workspace update builds one per repo. When an embedder is unavailable, build_embedder printed the same full "could not be built" warning for every build, stacking the identical sentence multiple times in one run and burying the signal.

build_embedder's degradation warning now fires at most once per process — matching the once-per-invocation gate the init header probe uses — so the first build of a run reports the degradation and later builds in the same invocation stay quiet.

Why now

Change

  • packages/cli/src/repowise/cli/providers/embedders.py — once-per-invocation gate (_degradation_warned) around the degradation warning, plus a reset_degradation_warning() hook so tests / embedded runners can re-arm it.
  • tests/unit/cli/test_embedder_resolution.py — tests that three degraded builds in one invocation warn exactly once, and that the warning returns after a reset.
  • tests/unit/cli/conftest.py — autouse fixture re-arms the gate between tests.

QA

  • ruff check and ruff format --check clean on changed files.
  • CLI unit suite: 2191 passed (the 1 failure is a pre-existing platform-path baseline, unrelated).

The embedder-degradation fallback was reported once per call site, not once
per invocation. A single 'repowise update' builds the embedder for its
decision semantic-dedup store and again for the deterministic page path, so a
repo with an unavailable embedder printed the same full warning twice in one
run (and a workspace update once per repo). build_embedder's degradation
warning now fires at most once per process, matching the init header probe,
with a reset hook so tests and embedded runners can re-arm it for the next
logical invocation.

@Ayush7614 Ayush7614 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified via diff: adds once-per-invocation gate _degradation_warned in packages/cli/src/repowise/cli/providers/embedders.py:1 with reset_degradation_warning() for tests, and autouse re-arm in conftest.py. Fixes R3 gap #852/#1370 where repowise update built embedder twice (incremental + deterministic) and spammed identical warnings. Tests cover 3 builds warn once + reset re-arms. Clean, no fake/unneeded code — LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants